import 'package:broadcast_events/broadcast_events.dart';

class BroadcastManager {

  // 注册通知
  static registerBroadcast(String name, Function(dynamic value) result) {
    BroadcastEvents().subscribe(name, result);
  }

  // 删除通知
  static deleteBroadcast(String name) {
    BroadcastEvents().unsubscribe(name);
  }

  // 发送通知
  static sendBroadcast(String name, {dynamic value}) {
    BroadcastEvents().publish(name, arguments: value);
  }

}